package com.cw.demo.thread;

import java.util.stream.IntStream;

/**
 * TODO
 *
 * @author chenw
 * @date 2021/10/9
 */
public class T1 implements Runnable {
    @Override
    public void run() {
        System.out.println(String.format("当前执行的线程是：%s,优先级是：%d", Thread.currentThread()
            .getName(), Thread.currentThread()
            .getPriority()));
    }

    public static void main(String[] args) {
        IntStream.range(1,10).forEach(i->{
            Thread thread = new Thread(new T1());
            thread.setPriority(i);
            thread.start();
        });
    }
}
